14. SIM related Commands > 14.1 AT+CRSM   Restricted SIM Access

14.1
AT+CRSM   Restricted SIM Access
AT+CRSM offers easy access of the Elementary Files on the SIM. Access to the SIM database is restricted to the commands which are listed at <command>. However, additional SIM commands are available via AT^SXSM.
All parameters of AT+CRSM are used as specified by GSM 11.11 [26]. TC65 handles internally all required SIM interface locking and file selection routines.
As response to the command, the TC65 sends the actual SIM information parameters and response data. Error result code "+CME ERROR" may be returned if the command cannot be passed to the SIM, e.g. if the SIM is not inserted. However, failure in the execution of the command in the SIM is reported in <sw1> and <sw2> param­eters.

AT+CRSM requires PIN authentication. However, using <command> "READ BINARY" and <command> "READ RECORD" is possible before PIN authentication and if the SIM is blocked (state after three failed PIN authenti­cation attempts) to access the contents of the following Elementary Files:
 
EFICCID
EFELP
EFLP
EFSPN
EFAD
EFPhase
EFECC

Please beware of possible changes to Elementary Files by the network at any time, refer Chapter 14., SIM related Commands.
Syntax
Test Command  
Response(s)
Write Command  
Response(s)
Reference(s) 
PIN 
ASC0 
ASC1 
USB 
MUX1 
MUX2 
MUX3 
Charge 
Last 
GSM 07.07

Parameter Description
 
SIM command number.
176
READ BINARY
178
READ RECORD
192
GET RESPONSE
214
UPDATE BINARY
220
UPDATE RECORD
242
STATUS
 
Identifier for an elementary data file on SIM, if used by <command>.
 
<P1>(num)
Parameter to be passed on by the TC65 to the SIM.
0...255
 
 
<P2>(num)
Parameter to be passed on by the TC65 to the SIM.
0...255
 
 
<P3>(num)
Parameter to be passed on by the TC65 to the SIM.
0...255
 
 
<data>(str)
Information which shall be written to the SIM (hexadecimal character format).
 
<sw1>(num)
Status information from the SIM about the execution of the actual command. It is returned in both cases, on suc­cessful or failed execution of the command.
0...255
 
 
<sw2>(num)
Status information from the SIM about the execution of the actual command. It is returned in both cases, on suc­cessful or failed execution of the command.
0...255
 
 
Response data in case of a successful completion of the previously issued command.
"STATUS" and "GET RESPONSE" commands return data, which gives information about the currently selected elementary data field. This information includes the type of file and its size.
After "READ BINARY" or "READ RECORD" commands the requested data will be returned.
<response> is empty after "UPDATE BINARY" or "UPDATE RECORD" commands.